package com.kingdee.shr.perfweb.publicity.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.hr.perf.PerfPubilcityBillEntryCollection;
import com.kingdee.eas.hr.perf.PerfPubilcityBillEntryInfo;
import com.kingdee.eas.hr.perf.PerfPubilcityBillInfo;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.base.syssetting.web.handler.EditHandler;
import com.kingdee.shr.perfweb.app.common.YesOrNoEnum;

public class PerfPublicityBillNoticEditHandler extends EditHandler {
	@Override
	protected void afterInitModel(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo coreBaseInfo)
			throws SHRWebException {
		PerfPubilcityBillInfo info = (PerfPubilcityBillInfo) coreBaseInfo;
		PerfPubilcityBillEntryCollection entrys = info.getEntrys();
		PerfPubilcityBillEntryCollection copyEntry = new PerfPubilcityBillEntryCollection();
		for(int i = 0,size = entrys.size(); i < size; i++){
			PerfPubilcityBillEntryInfo perfPubilcityBillEntryInfo = entrys.get(i);
			if(perfPubilcityBillEntryInfo.getIspub().equals(YesOrNoEnum.YES)){
				copyEntry.add(perfPubilcityBillEntryInfo);
			}
		}
		info.getEntrys().clear();
		info.getEntrys().addCollection(copyEntry);
	}
}
